set mem 500m
set more off
cap cd "C:\Users\ejm5\Dropbox\Rents_Asunder\AJPS_ReplicationFiles\data"
cap cd "/Users/dimitargueorguiev/Dropbox/Rents_Asunder/AJPS_ReplicationFiles/data/"

use 20140308_money_d1.dta, clear


cap cd "C:\Users\ejm5\Dropbox\Rents_Asunder\AJPS_ReplicationFiles\output"
cap cd "/Users/dimitargueorguiev/Dropbox/Rents_Asunder/AJPS_ReplicationFiles/output/"


/*************************************APPENDIX 10: ANALYSIS OF DOMESTIC FIRMS AND POLITICAL CONNECTIONS*********************************************/

set more off
log using table5.smcl, replace


/*Model 1: Just Firms in Restricted Sectors*/
set more off 
xi: nbreg reg_corrupt  if treatment==0  & FDI==0 & reg_year>=2000, robust cluster(pci_id)
predict ns_items
generate bribe=reg_corrupt-ns_items
nl (bribe = {b0}) if treatment==1  & FDI==0 & reg_year>=2000, cluster(pci_id) vce(bootstrap, reps(1000))  
estimates store c
outreg2 using rents_connections.xls, bdec(3) tdec(3) e(all) replace
drop ns_items bribe

/*Model 2: Controls*/
xi: nbreg reg_corrupt equity_est y2011 y2012 time time_sq  restrict_all connection_dich restrict_all_connect  if treatment==0  & FDI==0 & reg_year>=2000, robust cluster(pci_id)
predict ns_items
generate bribe=reg_corrupt-ns_items
nl (bribe = {b0}+{b1}*equity_est+{b2}*y2011+{b3}*y2012+{b4}*time+{b5}*time_sq+{b6}*restrict_all+{b7}*connection_dich +{b8}*restrict_all_connect+{b9}) if treatment==1  & FDI==0 & reg_year>=2000, cluster(pci_id) vce(bootstrap, reps(1000))    variables (y2011 y2012  equity_est time time_sq restrict_all connection_dich restrict_all_connect)
estimates store c2
mfx
outreg2 using rents_connections.xls, mfx bdec(3) tdec(3) e(all)
drop ns_items bribe
lrtest c c2, force


/*Model 3: Size and Complexity*/
set more off
xi: nbreg reg_corrupt equity_est y2011 y2012 time time_sq  restrict_all connection_dich restrict_all_connect expand labor_est MBA  if treatment==0  & FDI==0 & reg_year>=2000, robust cluster(pci_id)
predict ns_items
generate bribe=reg_corrupt-ns_items
nl (bribe = {b0}+{b1}*equity_est+{b2}*y2011+{b3}*y2012+{b4}*time+{b5}*time_sq+{b6}*restrict_all+{b7}*connection_dich +{b8}*restrict_all_connect+{b9}*expand+{b10}*labor_est+{b11}*MBA) if treatment==1  & FDI==0 & reg_year>=2000, cluster(pci_id) vce(bootstrap, reps(1000))    variables (y2011 y2012  equity_est time time_sq restrict_all connection_dich restrict_all_connect expand labor_est MBA)
estimates store c3
mfx
outreg2 using rents_connections.xls, mfx bdec(3) tdec(3) e(all)
drop ns_items bribe
lrtest c c3, force

/*Models 4 through 6 - Disaggregated Connections*/
xi: nbreg reg_corrupt equity_est y2011 y2012 time time_sq  restrict_all connection_gov restrict_all_connect_gov expand labor_est MBA if treatment==0  & FDI==0 & reg_year>=2000, robust cluster(pci_id)
predict ns_items
generate bribe=reg_corrupt-ns_items
nl (bribe = {b0}+{b1}*equity_est+{b2}*y2011+{b3}*y2012+{b4}*time+{b5}*time_sq+{b6}*restrict_all+{b7}*connection_gov+{b8}*restrict_all_connect_gov+{b9}*expand+{b10}*labor_est+{b11}*MBA) if treatment==1  & FDI==0 & reg_year>=2000, cluster(pci_id) vce(bootstrap, reps(1000))    variables (y2011 y2012  equity_est time time_sq restrict_all connection_gov restrict_all_connect_gov expand labor_est MBA)
estimates store c4
mfx
outreg2 using rents_connections.xls, mfx bdec(3) tdec(3) e(all)
drop ns_items bribe
lrtest c c4, force

/*Model 5*/
xi: nbreg reg_corrupt equity_est y2011 y2012 time time_sq  restrict_all connection_mil restrict_all_connect_mil expand labor_est MBA if treatment==0  & FDI==0 & reg_year>=2000, robust cluster(pci_id)
predict ns_items
generate bribe=reg_corrupt-ns_items
nl (bribe = {b0}+{b1}*equity_est+{b2}*y2011+{b3}*y2012+{b4}*time+{b5}*time_sq+{b6}*restrict_all+{b7}*connection_mil+{b8}*restrict_all_connect_mil+{b9}*expand+{b10}*labor_est+{b11}*MBA) if treatment==1  & FDI==0 & reg_year>=2000, cluster(pci_id) vce(bootstrap, reps(1000))    variables (y2011 y2012  equity_est time time_sq restrict_all connection_mil restrict_all_connect_mil expand labor_est MBA)
estimates store c5
mfx
outreg2 using rents_connections.xls, mfx bdec(3) tdec(3) e(all)
drop ns_items bribe
lrtest c c5, force


/*Model 6b - SOE*/
xi: nbreg reg_corrupt equity_est y2011 y2012 time time_sq  restrict_all connection_soe restrict_all_connect_soe  expand labor_est MBA if treatment==0  & FDI==0 & reg_year>=2000 & connection_soe_b==0, robust cluster(pci_id)
predict ns_items
generate bribe=reg_corrupt-ns_items
nl (bribe = {b0}+{b1}*equity_est+{b2}*y2011+{b3}*y2012+{b4}*time+{b5}*time_sq+{b6}*restrict_all+{b7}*connection_soe+{b8}*restrict_all_connect_soe+{b9}*expand+{b10}*labor_est+{b11}*MBA) if treatment==1  & FDI==0 & reg_year>=2000, cluster(pci_id) vce(bootstrap, reps(10))    variables (y2011 y2012  equity_est time time_sq restrict_all connection_soe restrict_all_connect_soe expand labor_est MBA)
estimates store c6
mfx
outreg2 using rents_connections.xls, mfx bdec(3) tdec(3) e(all) excel
drop ns_items bribe
lrtest c c6, stat force




/*LR TESTS*/
lrtest c c2, stats force
lrtest c c3, stats force
lrtest c c4, stats force
lrtest c c5, stats force
lrtest c c6, stats force
log close

cap cd "C:\Users\ejm5\Dropbox\Rents_Asunder\AJPS_ReplicationFiles\do"
cap cd "/Users/dimitargueorguiev/Dropbox/Rents_Asunder/AJPS_ReplicationFiles/do/"
